package com.lq.leetcode;

/**
 * Main283
 *
 * @author qingqing
 * @date 2025/3/2
 */

public class Main283 {
    public void moveZeroes(int[] nums) {
        int zeroIdx = 0;
        int numIdx = 0;

        while (numIdx < nums.length) {
            if (nums[numIdx] != 0) {
                int temp = nums[numIdx];
                nums[numIdx] = nums[zeroIdx];
                nums[zeroIdx] = temp;
                zeroIdx++;
            }
            numIdx++;

        }


    }
}
//  z
//  i
//  0  0  1

// 1 2 3 0